<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="css/login.css"/>
	</head>
	<body>
		<div id="box">
			<header class="header-top">
			 <button class="btn"><i class="iconfont">&#xe619;</i></button>
			 <h2>用户注册</h2>
			</header>
			<section class="content">
				<div class="account">
					<span>账户名称 :</span>
					<input  type="text" name="" id="username" placeholder="请输入账号" />
				</div>
				<div class="account">
					<span>登录密码 :</span>
					<input type="password" name="" id="password" placeholder="请输入密码" />
				</div>
				<div class="account">
					<span>登录密码 :</span>
					<input type="password" name="" id="password2" placeholder="请输入密码" />
				</div>
				<div class="register">确认注册</div>
			</section>
		</div>
		
	</body>
	<script type="text/javascript" src="js/jquery-2.0.3.js"></script>
	<script type="text/javascript">
	
	$(function(){
		$(".register").on("click",function(){
			$.ajax({
			type:'GET',
			url:'http://datainfo.duapp.com/shopdata/userinfo.php',
			dataType:'json',
			data:{
				status:"register",
			     userID:$('#username').val(),
			     password:$('#password').val()
			},
			success:function(data){
			    if(data==0){
			    	alert("您的用户名已被占用")
			    }else if(data==1){
			    	alert("注册成功")
			    }else {
			    	alert("您的格式不对")
			    }
			    if(data==1){
				window.location.href="denglu.html"
			}
			}
			
		})
		
		})
		
		
		
		function bodyScale(){
				var devicewidth=document.documentElement.clientWidth;
				var scale=devicewidth/640;
				document.body.style.zoom=scale;
			}
			window.onresize=window.onload=function(){
				bodyScale();
			}
	})
		
	</script>
</html>
